﻿@{
    Layout = null;
}
@using CNKI.TPI.Web.Search.Model;
@using CNKI.TPI.Web.Base
<script>
    function searchHistory() {
        $('#pageIndexNow').val(1);
        copySearchCondition()
        searchHistoryData()
    }
    $(function () {
        searchHistory();
    })
    function searchHistoryData() {
        $.ajax({
            type: "GET",
            url: timestamp("@Html.Raw(Url.Action("SearchHistorySearch", "UserCenter"))"),
            data: { "dbname": $('#hiddenDbName').val(), "startdate": $('#hiddenStartdate').val(), "enddate": $('#hiddenEnddate').val(), "pageIndexNow": $('#pageIndexNow').val() },
            beforeSend: function () { $("#loading").show(); },
            success: function (msg) {
                $("#docSearchHistory").html("");
                $("#docSearchHistory").html(msg);
                $("#loading").hide();
            },
            error: function (e)
            { $("#loading").hide(); }
        })
    }
    //点击分页
    function searchPageNew(n) {
        $('#pageIndexNow').val(n);
        searchHistoryData();
    }

    function copySearchCondition()
    {
        $('#hiddenDbName').val($('#dbname').val());
        $('#hiddenStartdate').val($('#startdate').val());
        $('#hiddenEnddate').val($('#enddate').val());
    }

    $(document).keydown(function (event) {
        if (event.keyCode == 13) {
            $('#pageIndexNow').val(1);
            copySearchCondition()
            searchHistory();
        }
    });
</script>
<div class="wrapR-h" style="padding-top: 20px; padding-bottom: 20px">
    <input type="hidden" id="pageIndexNow" name="pageIndexNow" value="1" />
    <div class="form form-h">
        <div class="f-gp">
            <div class="f-lb">
                <label class="f-label">数据库名称：</label>
            </div>
            <div class="f-ct f-ml">
                <input type="text" class="f-text span3" id="dbname" maxlength="64">
                <input type="hidden" class="f-text span4" id="hidegroupname">
            </div>
            <br />
            <div>
                <label class="f-label">检索时间：</label>
                @{
                    string startd = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
                }
                <input type="text" class="f-text span3" id="startdate" readonly="true" value="@startd" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'enddate\')}',dateFmt:'yyyy-MM-dd' })">
                至
                @{
                    string ed = System.DateTime.Now.ToString("yyyy-MM-dd");
                }
                <input type="text" class="f-text span3" id="enddate" readonly="true" value="@ed" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startdate\')}',dateFmt:'yyyy-MM-dd' })">
                <a class="btn btn-submit btn-warn-f" onclick="searchHistory()">检索</a>
                <input type="hidden" name="hiddenDbName" id="hiddenDbName" value=""/>
                <input type="hidden" name="hiddenStartdate" id="hiddenStartdate" value="" />
                <input type="hidden" name="hiddenEnddate" id="hiddenEnddate" value="" />
            </div>
        </div>
    </div>
</div>
<div class="wrapR-c">
    <div id="docSearchHistory">
    </div>
</div>




